<template>
  <figure class="my-8">
    <img :src="image.src" :alt="image.alt" class="w-full h-auto rounded-lg shadow-md">
    <figcaption v-if="image.caption" class="mt-2 text-center text-sm text-gray-500">
      {{ image.caption }}
    </figcaption>
  </figure>
</template>

<script>
export default {
  name: 'ImageBlock',
  props: {
    image: {
      type: Object,
      required: true,
      validator: (value) => {
        return value.src && typeof value.src === 'string';
      }
    }
  }
};
</script>

<style scoped>
/* 组件样式可以在这里添加 */
</style>